package com.atl.common;

/**
 * 错误码
 *
 * @author: 临晖
 * @since: 2024-05-18
 */
public enum ErrorCode {

    /**
     * 服务器错误
     */
    SERVER_ERR(-10, "server error"),
    /**
     * 失败
     */
    FAILURE(-1, "FAILURE"),
    // 成功
    SUCCESS(200,"操作成功"),
    // 登录
    NEED_LOGIN(401,"需要登录后操作"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    SYSTEM_ERROR(500,"出现错误"),
    USERNAME_EXIST(501,"用户名已存在"),
    PHONENUMBER_EXIST(502,"手机号已存在"),
    EMAIL_EXIST(503, "邮箱已存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    LOGIN_ERROR(505,"用户名或密码错误"),
    FILE_ERROR(505,"文件格式只能为png"),
    //参数校验
    AUTH_ERR(-3, "认证失败"),
    PARAM_ERR(-2, "参数校验失败"),
    NICK_EXIST (501,"用户名已存在"),
    IS_NOt(506,"查询内容为空"),
    DLET_ERROR(500, "删除失败"),
    UPDATE_ERROR(500, "修改失败"),
    ADD_ERROR(502, "添加失败"),
    SYSTEM_DEL_ERROR(-1, "菜单在使用，请禁用角色后删除"),
    System_ROLE_DEL_ERROR(-1, "菜单在使用，请禁用用户后删除"),
    ADDUSER_ERROR(-1, "普通用户不能添加角色"),
    DlETE_CHILDREN_ERROR(-1, "存在子菜单，不能删除"),
    FILE_UP_ERROR(501, "文件上传失败"),
    PHONENO_ERROR(504, "手机号格式错误"),
    ARGUMENT_ERROR(-1, "参数错误"),

    EMAIL_ERROR(504, "邮箱格式错误"),
    FILE_NOT_NULL(-1,"文件有空白字段" ),
    FILE_DOWLOAD_ERROR(505, "文件下载失败"),
    UPDATE_USER_IDNUMBER(501,"用户名或身份证号有误"),
    UPDATE_PWD_ERROR(-1, "密码不正确"),
    USERNAME_ERROR(501, "用户名错误"),
    ENTER_INFORMATION(500,"无用户图表信息"),
    REMOTE_CONTROL_NOT(500,"无此远程操控者或此远程查看者账号被封禁"),
    ID_NUMBER_NOT_VALID(500,"身份证号码不规范，请输入18位身份证号"),
    NOT_ADMIN_DELETE(500,"此用户为管理员，您无权删除");


    int code;
    String msg;


    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
